package com.xqt.dao.sys;

import com.xqt.base.dao.BaseDao;
import com.xqt.base.page.BasePage;
import com.xqt.entity.sys.SysMember;
import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 用户基础表Dao
 * 
 * @author 梁华

 */
@Repository
public class SysMemberDao extends BaseDao<SysMember>{

	@Override
	public String getReadSql() {
		return "read.sysmember.";
	}

	@Override
	public String getWriteSql() {
		return "write.sysmember.";
	}


	public SysMember queryByName(Object name){
		return  readSqlSession.selectOne(getReadSql()+"queryByName",name);
	};

	public SysMember queryByMobile(Object mobile){
		return readSqlSession.selectOne(getReadSql()+"queryByMobile",mobile);
	}

	public SysMember queryByItemId(SysMember sysMember){
		return readSqlSession.selectOne(getReadSql()+"queryByItemId",sysMember);
	}

	public List<SysMember> selectByRoleId(Object roleId){
		return readSqlSession.selectList(getReadSql()+"selectByRoleId",roleId);
	};

	public SysMember queryByShop(SysMember sysMember){
		return readSqlSession.selectOne(getReadSql()+"queryByShop",sysMember);
	}

}
